/*
 * @Author: january.cjy
 * @Date: 2021-09-27 19:34:02
 * @Last Modified by: january.cjy
 * @Last Modified time: 2021-09-29 21:13:34
 */
#include <CmgASTConsumer.h>
#include <clang/Basic/FileManager.h>

namespace cmg {

using namespace clang;
using namespace llvm;

CmgASTConsumer::CmgASTConsumer(ASTContext &context, SourceManager &sm,
                               Preprocessor &pp)
    : visitor(context, sm), ctx(context), sm(sm), pp(pp) {}
void CmgASTConsumer::HandleTranslationUnit(clang::ASTContext &Context) {
  llvm::outs() << "CmgASTConsumer: "
               << sm.getFileEntryForID(sm.getMainFileID())->getName() << '\n';
  this->visitor.TraverseDecl(Context.getTranslationUnitDecl());
}
} // namespace cmg